package cn.sys.utils;

/**
 * @author Mxb
 * @version 1.0
 * @date 2019/10/29 20:22
 */
public class ResultObj {
    private Integer code = 0;
    private String msg;


    //    添加成功              1
    public static final ResultObj ADD_SUCCESS = new ResultObj(0,"添加成功！");
    public static final ResultObj ADD_ERROR = new ResultObj(-1,"添加失败！");

    //更新成功
    public static final ResultObj UPDATE_SUCCESS = new ResultObj(0, "修改成功");
    public static final ResultObj UPDATE_ERROR = new ResultObj(-1, "修改失败");

    //    删除
    public static final ResultObj DELETE_SUCCESS = new ResultObj(0,"删除成功！");
    public static final ResultObj DELETE_ERROR = new ResultObj(-1, "删除失败！");

    //    重置
    public static final ResultObj RESET_SUCCESS = new ResultObj(0, "重置成功");
    public static final ResultObj RESET_ERROR = new ResultObj(-1, "重置失败");

    //    状态吗 >=0代表成功
    public static final ResultObj STATUS_TRUE = new ResultObj(0);
    //    状态吗 <0 失败
    public static final ResultObj STATUS_ERROR = new ResultObj(-1);

    public ResultObj(Integer code) {
        this.code = code;
    }

    //  构造
    private ResultObj(Integer code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
